package com.apimarket.util.kong;

import com.apimarket.entity.kong.Consumer;
import com.apimarket.enums.NotSupportOperationEnum;
import com.apimarket.exception.NotSupportOperationException;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

public abstract class KongConsumer<T> extends KongBase implements KongConsumerOperation<T> {
    protected static final String bindPrefix = "/consumers";

    public KongConsumer() {
    }

    public KongConsumer(String baseUrl) {
        super(baseUrl);
    }

    @Override
    public Consumer addConsumer(Consumer consumer) {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public Consumer getConsumer(Consumer consumer) {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public List<Consumer> listConsumers() {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public Consumer updateConsumer(Consumer consumer) {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public void deleteConsumer(String nameOrId) {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public T bindPlugin(String nameOrId, Object... args) throws IOException, URISyntaxException {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public List<T> listAllBindPluginDetail() throws IOException, URISyntaxException {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }

    @Override
    public List<T> listBindPluginDetailViaConsumer(String nameOrId) throws IOException, URISyntaxException {
        throw new NotSupportOperationException(NotSupportOperationEnum.KONG_ERROR);
    }
}
